new Vue({
    el:'#app',
    data:{
        Case_law:{
            caseId:'',
            clientId:{
                clientId:''
            },
            oppositeId:{
                clientId:''
            },
            caseTypeid:{
                caseTypeid:''
            },
            thirdParty:'',
            objectOfAction:'',
            locusStandi:'',
            agencyMoney:'',
            blendMoney:'',
            courtId:{
                courtId:''
            },
            stateSessionDate:'',
            sessionDate:'',
            causeOfAction:'',
            causeDetails:'',
            mainLawyer:{
                empId:''
            },
            version:'',
            comment:'',
            submitId:{
                userId:''
            }
        },
        tableData:[],
        audits:[],
        imgsrc:'../../layuiadmin/js/audit/img/审批中.png'
    },
    created(){
      this.init();  
    },
    methods:{
        init(){ //根据流程id查询对应案件信息
            const loading = this.$loading({
                lock: true,
                text: 'Loading',
                spinner: 'el-icon-loading',
                background: 'rgba(0, 0, 0, 0.7)'
            });
            var processid = getUrlParam("processid");
            //根据流程id查询案件相关的内容。
            this.$http.post("http://localhost:8080/audit/queryCaseByProcessid"
                ,{"processid":processid},{emulateJSON:true}).then(result=>{
                var msg = eval("("+result.body+")")
                this.Case_law = msg.data;
            });
            
            //根据流程id查询出流程的审批记录
            this.$http.post("http://localhost:8080/audit/findProcessListByProcessid",
                {"processid":processid},{emulateJSON:true}).then(result=>{
                var msg = eval("("+result.body+")")
                this.audits = msg.data;
                
                var state = this.audits[0].if_pass; //根据审核状态显示出不同的图片
                if(state==''){
                    this.imgsrc = "../../layuiadmin/js/audit/img/审批中.png";
                }else if(state=="通过"){
                    this.imgsrc = "../../layuiadmin/js/audit/img/通过.png";
                }else if(state=="不通过"){
                    this.imgsrc = "../../layuiadmin/js/audit/img/不通过.png";
                }
            });
            loading.close();
        }
    }
});